home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / PRGMANIA / VERSION1.5 / XGEMFAST.H < prev   
Encoding:
C/C++ Source or Header  |  1996-05-18  |  29.3 KB  |  1,030 lines

  1. /* tab expansion/compression should be set to 4 */
  2. /**************************************************************************
  3.  *
  4.  * GEMFAST.H - Header file for common VDI and AES symbols.
  5.  
  6.  this is gemfast.h for xvdifast and xaesfast library
  7.  (SOZOBON eXtended version's GEM library)
  8.  It is based on the original gemfast.h, with little changes. So I kept
  9.  all other stuff in here. -jerry-
  10.  
  11.  *
  12.  *    This header file contains items compatible with both GEMDEFS and OBDEFS
  13.  *    from the Alcyon system.  Note that there are no 'extern' definitions
  14.  *    for the GEM functions, because they all return a signed int and work
  15.  *    fine as autodefined functions.
  16.  *
  17.  *    If you have a lot of source already coded for #include <gemdefs.h>,
  18.  *    you can create a dummy (empty) obdefs.h file, and code a new gemdefs.h
  19.  *    file which contains only #include <gemfast.h>.    YOU CAN NO LONGER USE
  20.  *    GEMDEFS AND OBDEFS WITH THE GEMFAST BINDINGS!  For the bindings libs
  21.  *    to work correctly, this header file must be used.
  22.  *
  23.  * Credits dept:
  24.  *     This file bears an amazing similarity to the original Alcyon GEMDEFS
  25.  *     and OBDEFS header files, which are copyrighted by Atari.  What can I
  26.  *     say?  Copyrighted or not, these are the names and values that every-
  27.  *     body uses, so OF COURSE the files look *awful* similar...
  28.  *
  29.  * Maintenance:
  30.  *    12/03/89 - v1.3
  31.  *               > Renamed a lot of functions, a name compatibility block was
  32.  *                 added at the end of this file to smooth the transition.
  33.  *               > Added NO_OBJECT, MU_MENTRY, MU_MEXIT to defines.
  34.  *               > Added XMULTI struct, even though it really belongs to v2.0
  35.  *    05/26/90 - v1.4
  36.  *               > Added RSHDR structure for imbedded resource support.
  37.  *               > Fixed all structures which defined pointers as 'long'...
  38.  *                 - ICONBLK ib_pmask, ib_pdata, ib_ptext
  39.  *                 - BITBLK  bi_pdata
  40.  *                 - USERBLK ub_code
  41.  *                 - PARMBLK pb_tree
  42.  *                 All of these structure elements now define the proper ptr.
  43.  *               > Added AESUTIL_A, AESFAST_A and VDIFAST_A symbols.    This
  44.  *                 allows specific indication of the presence or abscence of
  45.  *                 the bindings libraries, allowing a programmer to use the
  46.  *                 GEMFAST.H header without using the rest of GemFast.  This
  47.  *                 also allows conditional compilation code to be more
  48.  *                 specific:    it can now test for the presence of the header
  49.  *                 file (and handle the differences in the structure defs),
  50.  *                 and it can separately test for the presence of the libs,
  51.  *                 and the extended functions available therein.
  52.  *************************************************************************/
  53.  
  54. #ifndef GEMFAST_H                /* Prevent multiple inclusion */
  55.     /* xgemfast is based on:    */
  56. #define GEMFAST_H        1        /* Tell the world GEMFAST header is used */
  57. #define GEMF_VERSION    0x0141    /* Tell the world we are v1.41             */
  58. #define AESUTIL_A        1        /* Tell the world AESFAST utils  available */
  59.  
  60. #define _XGEMFAST        1        /* Tell the world XGEMfast is used */
  61. #define _XAESFAST_A        0x104    /* Tell the world XAESFAST lib is used */
  62. #define _XVDIFAST_A        0x105    /* Tell the world XVDIFAST lib is used */
  63. #define    _XAESFASTVERSION "1.04"
  64. #define    _XVDIFASTVERSION "1.05"
  65.  
  66.  
  67.     /* the aes variables are to find at end of file    */
  68.  
  69. typedef struct                /* Ajout */
  70. {
  71.     int    contrl[15];
  72.     int    global[80];
  73.     int    intin[128];
  74.     int    intout[45];
  75.     int    ptsout[128];
  76.     void    *addrin[128];
  77.     void    *addrout[6];
  78.     int    ptsin[128];
  79. }    GEMPARBLK;
  80.  
  81. GEMPARBLK    _GemParBlk;
  82. GEMPARBLK    Gem_pb;            /* fin ajout */
  83.  
  84.     /* the VDI constants    */
  85.  
  86.                                 /* VDI inside fill styles - new names    */
  87. #if 0
  88.  
  89. #define VIS_HOLLOW    0            /* these names will be phased out soon... */
  90. #define VIS_SOLID    1
  91. #define VIS_PATTERN 2
  92. #define VIS_HATCH    3
  93. #define VIS_UDPTRN    4
  94.  
  95. #define VIP_HOLLOW    0            /* these names will be phased out soon... */
  96. #define VIP_1PTRN    1
  97. #define VIP_2PTRN    2
  98. #define VIP_3PTRN    3
  99. #define VIP_4PTRN    4
  100. #define VIP_5PTRN    5
  101. #define VIP_6PTRN    6
  102. #define VIP_SOLID    7
  103.  
  104. #endif
  105.                             /* polyline types    */
  106. enum {LT_SOLID =1, LT_LONGDASH, LT_DOTTED, LT_DASHDOT, LT_DASHED,
  107.         LT_DASHDOTDOT, LT_USERDEF};
  108.  
  109.                                 /* polyline end styles    */
  110. enum {LE_SQUARED, LE_ARROWED, LE_ROUNDED};
  111.  
  112.                                 /* default polymarker types    */
  113. enum {MT_DOT = 1, MT_PLUS, MT_ASTERIK, MT_SQUARE, MT_DCROSS, MT_DIAMOND};
  114.  
  115.                                 /* graphic test special effects    */
  116. #define TF_NORMAL        0x00
  117. #define TF_THICKENED    0x01
  118. #define TF_LIGTHENED    0x02
  119. #define TF_SLANTED        0x04
  120. #define TF_UNDERLINED    0x08
  121. #define TF_OUTLINED        0x10
  122. #define TF_SHADOWED        0x20
  123.                                 /* text alignment    */
  124. enum {TA_LEFT, TA_CENTER, TA_RIGHT};
  125. enum {TA_BASELINE, TA_HALF, TA_ASCENT, TA_BOTTOM, TA_DESCENT, TA_TOP};
  126.  
  127.                                 /* VDI interior fill index    */
  128. #define IS_HOLLOW    0
  129. #define IS_SOLID    1
  130. #define IS_PATTERN    2
  131. #define IS_HATCH    3
  132. #define IS_UDPTRN    4
  133.                             /* alternative names:    */
  134. enum {FIS_HOLLOW, FIS_SOLID, FIS_PATTERN, FIS_HATCH, FIS_USER};
  135.  
  136.                                 /* VDI inside fill style index    */
  137.     /* (scanning) patterns (together with FIS_PATTERN)    */
  138. #define IP_HOLLOW    0
  139. #define IP_1PTRN    1
  140. #define IP_2PTRN    2
  141. #define IP_3PTRN    3
  142. #define IP_4PTRN    4
  143. #define IP_5PTRN    5
  144. #define IP_6PTRN    6
  145. #define IP_7PTRN    7
  146. #define IP_SOLID    8
  147.     /* different patterns up to 24 follow    */
  148. #define IP_BRICK    9
  149. #define IP_LAST        24
  150.  
  151.     /* hatchings (together with FIS_HATCH)    */
  152. #define IP_1HATCH    1
  153. #define IP_2HATCH    2
  154. #define IP_3HATCH    3
  155. #define IP_4HATCH    4
  156. #define IP_5HATCH    5
  157. #define IP_6HATCH    6
  158. #define IP_7HATCH    7
  159. #define IP_8HATCH    8
  160. #define IP_9HATCH    9
  161. #define IP_10HATCH    10
  162. #define IP_11HATCH    11
  163. #define IP_12HATCH    12
  164.  
  165.  
  166.                                /* VDI normal graphics drawing modes */
  167. #define MD_REPLACE    1
  168. #define MD_TRANS    2
  169. #define MD_XOR        3
  170. #define MD_ERASE    4
  171.                                /* VDI bit blt rules */
  172. #define ALL_WHITE    0
  173. #define S_AND_D        1
  174. #define S_AND_NOTD    2
  175. #define S_ONLY        3
  176. #define NOTS_AND_D    4
  177. #define D_ONLY        5
  178. #define S_XOR_D        6
  179. #define S_OR_D        7
  180. #define NOT_SORD    8
  181. #define NOT_SXORD    9
  182. #define D_INVERT    10
  183. #define NOT_D        10
  184. #define S_OR_NOTD    11
  185. #define NOT_S        12
  186. #define NOTS_OR_D    13
  187. #define NOT_SANDD    14
  188. #define ALL_BLACK    15
  189.  
  190.                 /* VDI and AES colors    */
  191.  
  192. #define WHITE        0
  193. #define BLACK        1
  194. #define RED            2
  195. #define GREEN        3
  196. #define BLUE        4
  197. #define CYAN        5
  198. #define YELLOW        6
  199. #define MAGENTA        7
  200. #define LWHITE        8
  201. #define LBLACK        9
  202. #define LRED        10
  203. #define LGREEN        11
  204. #define LBLUE        12
  205. #define LCYAN        13
  206. #define LYELLOW        14
  207. #define LMAGENTA    15
  208.  
  209.  
  210.     /* the AES constants    */
  211.  
  212.                                     /* font types */
  213. #define IBM            3
  214. #define SMALL        5
  215.  
  216.                                     /* evnt_multi flags */
  217. #define MU_KEYBD    0x0001
  218. #define MU_BUTTON    0x0002
  219. #define MU_M1        0x0004
  220. #define MU_M2        0x0008
  221. #define MU_MESAG    0x0010
  222. #define MU_TIMER    0x0020
  223.                                     /* evnt_mouse flags */
  224. #define MU_MENTRY    0x0000
  225. #define MU_MEXIT    0x0001
  226.                                     /* keyboard states */
  227. #define K_RSHIFT    0x0001
  228. #define K_LSHIFT    0x0002
  229. #define K_SHIFT        0x0003
  230. #define K_CTRL        0x0004
  231. #define K_ALT        0x0008
  232.  
  233.                     /* event message values */
  234.     /* extensions for AES 4.0 inserted    */
  235.  
  236. #define MN_SELECTED 10
  237. #define WM_REDRAW    20
  238. #define WM_TOPPED    21
  239. #define WM_CLOSED    22
  240. #define WM_FULLED    23
  241. #define WM_ARROWED    24
  242. #define WM_HSLID    25
  243. #define WM_VSLID    26
  244. #define WM_SIZED    27
  245. #define WM_MOVED    28
  246. #define WM_NEWTOP    29
  247. #define WM_UNTOPPED        30    /* AES 3.3 */
  248. #define WM_ONTOP        31    /* AES 3.3 */
  249.  
  250. #define WM_ICONIFY        34    /* AES 4.1 */
  251. #define WM_UNICONIFY    35    /* AES 4.1 */
  252. #define WM_ALLICONIFY    36    /* AES 4.1 */
  253.  
  254. #define AC_OPEN            40
  255. #define AC_CLOSE        41
  256. #define AP_TERM            50    /* AES 4.0 */
  257. #define AP_TFAIL        51    /* AES 4.0 */
  258. #define AP_RESCHG        57    /* AES 4.0 */
  259. #define SHUT_COMPLETED    60    /* AES 4.0 */
  260. #define RESCH_COMPLETED    61    /* AES 4.0 */
  261. #define AP_DRAGDROP        63    /* AES 4.0 */
  262. #define SH_WDRAW        72    /* AES 4.0 */
  263. #define CH_EXIT            90    /* AES 4.0    this is the real value */
  264.  
  265. #define WM_M_BDROPPED    100    /* MagiC 2.00    */
  266. #define SM_M_RES1        101 /* MagiC ?? */
  267.     /* ...    */
  268. #define SM_M_RES9        109 /* MagiC ?? */
  269.  
  270. #define    WA_UPPAGE    0
  271. #define    WA_DNPAGE    1
  272. #define    WA_UPLINE    2
  273. #define    WA_DNLINE    3
  274. #define    WA_LFPAGE    4
  275. #define    WA_RTPAGE    5
  276. #define    WA_LFLINE    6
  277. #define    WA_RTLINE    7
  278.  
  279.                         /* form_dial opcodes */
  280. #define FMD_START    0
  281. #define FMD_GROW    1
  282. #define FMD_SHRINK    2
  283. #define FMD_FINISH    3
  284.                                     /* rsrc_gaddr structure types */
  285. #define ROOT        0                /* this name used by MWC */
  286. #define R_TREE        0
  287. #define R_OBJECT    1
  288. #define R_TEDINFO    2
  289. #define R_ICONBLK    3
  290. #define R_BITBLK    4
  291. #define R_STRING    5
  292. #define R_IMAGEDATA 6
  293. #define R_OBSPEC    7
  294. #define R_TEPTEXT    8
  295. #define R_TEPTMPLT    9
  296. #define R_TEPVALID    10
  297. #define R_IBPMASK    11
  298. #define R_IBPDATA    12
  299. #define R_IBPTEXT    13
  300. #define R_BIPDATA    14
  301. #define R_FRSTR        15
  302. #define R_FRIMG        16
  303.                                     /* Window Attributes */
  304. #define NAME        0x0001
  305. #define CLOSER        0x0002
  306. #define FULLER        0x0004
  307. #define MOVER        0x0008
  308. #define INFO        0x0010
  309. #define SIZER        0x0020
  310. #define UPARROW        0x0040
  311. #define DNARROW        0x0080
  312. #define VSLIDE        0x0100
  313. #define LFARROW        0x0200
  314. #define RTARROW        0x0400
  315. #define HSLIDE        0x0800
  316.  
  317. #define HOTCLOSEBOX    0x1000    /* MagiC ?? */
  318. #define BACKDROP    0x2000    /* MagiC 1.00    */
  319. #define SMALLER        0x4000
  320.  
  321.                                     /* wind_calc flags */
  322. #define WC_BORDER    0
  323. #define WC_WORK        1
  324.                                     /* wind_get/set flags */
  325. #define WF_KIND        1
  326. #define WF_NAME        2
  327. #define WF_INFO        3
  328. #define WF_WORKXYWH 4
  329. #define WF_CURRXYWH 5
  330. #define WF_PREVXYWH 6
  331. #define WF_FULLXYWH 7
  332. #define WF_HSLIDE    8
  333. #define WF_VSLIDE    9
  334. #define WF_TOP        10
  335. #define WF_FIRSTXYWH 11
  336. #define WF_NEXTXYWH 12
  337. #define WF_RESVD    13
  338. #define WF_NEWDESK    14
  339. #define WF_HSLSIZE    15
  340. #define WF_VSLSIZE    16
  341. #define WF_SCREEN    17
  342. #define WF_COLOR    18    /* AES 3.3 */
  343. #define WF_DCOLOR    19    /* AES 3.3 */
  344. #define WF_OWNER    20    /* AES 3.3 */
  345. #define WF_BEVENT    24    /* AES 3.31 */
  346. #define WF_BOTTOM    25    /* AES 3.31 */
  347. #define WF_ICONIFY            26    /* AES 4.1 */
  348. #define WF_UNICONIFY        27    /* AES 4.1 */
  349. #define WF_UNICONIFYXYWH    28    /* AES 4.1 */
  350.  
  351. #define WF_M_OWNER        101        /* MagiC 2.00    */
  352. #define WF_M_WINDLIST    102        /* MagiC 2.00    */
  353. #define WF_M_BACKDROP    100        /* MagiC 2.00    */
  354.  
  355. #ifndef DONT_USE_Winx
  356.     /* Winx 2.1 ??    */
  357. #define WF_RETURN        1
  358. #define WF_WINX            22360
  359. #define    WF_WINXCFG        22361
  360.  
  361. #define WM_BOTTOMED        33
  362. #endif
  363.  
  364.                                     /* wind_update flags */
  365. #define END_UPDATE    0
  366. #define BEG_UPDATE    1
  367. #define END_MCTRL    2
  368. #define BEG_MCTRL    3
  369. #define BEG_CHECK    0x100
  370.     /* or 'BEG...' with BEG_CHECK for non blocking wind_update()
  371.         and test for an error (0)    */
  372.  
  373.                                     /* graf_mouse mouse types*/
  374. #define ARROW        0
  375. #define TEXT_CRSR    1
  376. #define BUSY_BEE    2
  377. #define HOURGLASS    2                /* these names are used too */
  378. #define BUSYBEE        2
  379. #define BEE            2
  380. #define POINT_HAND    3
  381. #define FLAT_HAND    4
  382. #define THIN_CROSS    5
  383. #define THICK_CROSS 6
  384. #define OUTLN_CROSS 7
  385. #define USER_DEF    255
  386. #define M_OFF        256
  387. #define M_ON        257
  388.  
  389. #define M_SAVE            258        /* MultiTOS */
  390. #define M_RESTORE        259        /* MultiTOS */
  391. #define M_PREV            260        /* MultiTOS */
  392.  
  393.     /* menu_bar modes    */
  394. #define    MENU_HIDE    0
  395. #define    MENU_SHOW    1
  396. #define    MENU_INSTL    100    /* MagiC 1.0    */
  397.  
  398.     /* objc_sysvar() */
  399. #define OB_GETVAR    0
  400. #define OB_SETVAR    1
  401.     /* the objc_sysvar ob_swich values     */
  402. #define    LK3DIND        1
  403. #define LK3DACT        2
  404. #define INDBUTCOL    3
  405. #define ACTBUTCOL    4
  406. #define BACKGRCOL    5
  407. #define AD3DVALUE    6
  408.  
  409.  
  410.                 /* objects    */
  411.  
  412.             /* max depth of search or draw    */
  413. #define MAX_DEPTH    8
  414.  
  415.             /* object types */
  416.             /* value returned by objc_find(), et. al. */
  417. #define NO_OBJECT    -1
  418. #define G_BOX        20
  419. #define G_TEXT        21
  420. #define G_BOXTEXT    22
  421. #define G_IMAGE        23
  422. #define G_USERDEF    24
  423. #define G_PROGDEF    24
  424. #define G_IBOX        25
  425. #define G_BUTTON    26
  426. #define G_BOXCHAR    27
  427. #define G_STRING    28
  428. #define G_FTEXT        29
  429. #define G_FBOXTEXT    30
  430. #define G_ICON        31
  431. #define G_TITLE        32
  432. #define G_CICON     33        /* AES 3.3 */
  433.  
  434. #define G_SWBUTTON    34        /* MagiC 1.00 */
  435. #define G_POPUP        35        /* MagiC 1.00 */
  436.  
  437.                                 /* object flags */
  438. #define NONE        0x0000
  439. #define SELECTABLE    0x0001
  440. #define DEFAULT        0x0002
  441. #define EXIT        0x0004
  442. #define EDITABLE    0x0008
  443. #define RBUTTON        0x0010
  444. #define LASTOB        0x0020
  445. #define TOUCHEXIT    0x0040
  446. #define HIDETREE    0x0080
  447. #define INDIRECT    0x0100
  448. #define        FL3DMASK    0x0600    /* 3D objects AES 3.4    */
  449. #define        FL3DNONE    0x0000
  450. #define    FL3DIND        0x0200
  451. #define    FL3DBAK        0x0400
  452. #define    FL3DACT        0x0600    /* last of 3D object flags    */
  453.  
  454.                                 /* Object states */
  455. #define NORMAL        0x0000
  456. #define SELECTED    0x0001
  457. #define CROSSED        0x0002
  458. #define CHECKED        0x0004
  459. #define DISABLED    0x0008
  460. #define OUTLINED    0x0010
  461. #define SHADOWED    0x0020
  462. #define WHITEBAK    0x0040
  463. #define DRAW3D        0x0080
  464.  
  465.                                 /* editable text field definitions */
  466. #define EDSTART        0
  467. #define ED_START    0        /* Pour compatibilité avec les autres compilateurs */
  468. #define EDINIT        1
  469. #define ED_INIT        1        /* Pour compatibilité avec les autres compilateurs */
  470. #define EDCHAR        2
  471. #define ED_CHAR        2        /* Pour compatibilité avec les autres compilateurs */
  472. #define EDEND            3
  473. #define ED_END        3        /* Pour compatibilité avec les autres compilateurs */
  474. #define    ED_CRSR        100     /* MagiC 1.00 */
  475. #define ED_DRAW        103     /* MagiC 2.00 */
  476.  
  477.                                 /* editable text justification */
  478. #define TE_LEFT        0
  479. #define TE_RIGHT    1
  480. #define TE_CNTR        2
  481.  
  482.                                 /* VDI Memory Form Definition Block */
  483. #if 0
  484. #ifndef FDADDR                    /* v1.3:  this typedef has been added to */
  485. typedef char *FDADDR;            /* help provide compatibility between     */
  486. #endif                            /* bindings systems.                     */
  487. #else
  488. typedef void *FDADDR;
  489. #endif
  490.  
  491. typedef struct fdbstr {
  492.     FDADDR        fd_addr;
  493.     short        fd_w;
  494.     short        fd_h;
  495.     short        fd_wdwidth;
  496.     short        fd_stand;
  497.     short        fd_nplanes;
  498.     short        fd_r1;
  499.     short        fd_r2;
  500.     short        fd_r3;
  501. } MFDB;
  502.  
  503. #define FDB    MFDB                    /* FDB for compatibily */
  504.  
  505.                                     /* Mouse Form Definition Block */
  506. typedef struct mfstr {
  507.     short mf_xhot;
  508.     short mf_yhot;
  509.     short mf_nplanes;
  510.     short mf_fg;
  511.     short mf_bg;
  512.     short mf_mask[16];
  513.     short mf_data[16];
  514. } MFORM ;
  515.  
  516. typedef struct grect {
  517.     short g_x;
  518.     short g_y;
  519.     short g_w;
  520.     short g_h;
  521. } GRECT;
  522.  
  523. typedef struct vrect {
  524.     short v_x1;
  525.     short v_y1;
  526.     short v_x2;
  527.     short v_y2;
  528. } VRECT;
  529.  
  530. typedef struct text_edinfo {
  531.     char    *te_ptext;                /* ptr to text                 */
  532.     char    *te_ptmplt;            /* ptr to template             */
  533.     char    *te_pvalid;            /* ptr to validation chrs.     */
  534.     short    te_font;                /* font                         */
  535.     short    te_junk1;                /* junk word                 */
  536.     short    te_just;                /* justification             */
  537.     short    te_color;                /* color information word     */
  538.     short    te_junk2;                /* junk word                 */
  539.     short    te_thickness;            /* border thickness             */
  540.     short    te_txtlen;                /* length of text string     */
  541.     short    te_tmplen;                /* length of template string */
  542. } TEDINFO;
  543.  
  544. typedef struct bftecolor {
  545. #if (SOZOBON  && __SOZOBONX__ < 0x223)
  546.     unsigned innercol:4;
  547.     unsigned fillpat:3;
  548.     unsigned textmode:1;
  549.     unsigned textcolor:4;
  550.     unsigned framecolor:4;
  551. #else
  552.     unsigned framecolor:4;
  553.     unsigned textcolor:4;
  554.     unsigned textmode:1;
  555.     unsigned fillpat:3;
  556.     unsigned innercol:4;
  557. #endif
  558. }bfTECOLOR;
  559.  
  560. typedef struct Xtext_edinfo {
  561.     char    *te_ptext;                /* ptr to text                 */
  562.     char    *te_ptmplt;                /* ptr to template             */
  563.     char    *te_pvalid;                /* ptr to validation chrs.     */
  564.     short    te_font;                /* font                         */
  565.     short    te_junk1;                /* junk word                 */
  566.     short    te_just;                /* justification             */
  567.     bfTECOLOR    te_color;            /* color information word     */
  568.     short    te_junk2;                /* junk word                 */
  569.     short    te_thickness;            /* border thickness             */
  570.     short    te_txtlen;                /* length of text string     */
  571.     short    te_tmplen;                /* length of template string */
  572. } XTEDINFO;
  573.  
  574. typedef struct icon_block {
  575.     short    *ib_pmask;
  576.     short    *ib_pdata;
  577.     char     *ib_ptext;
  578.     short    ib_char;
  579.     short    ib_xchar;
  580.     short    ib_ychar;
  581.     short    ib_xicon;
  582.     short    ib_yicon;
  583.     short    ib_wicon;
  584.     short    ib_hicon;
  585.     short    ib_xtext;
  586.     short    ib_ytext;
  587.     short    ib_wtext;
  588.     short    ib_htext;
  589. } ICONBLK;
  590.  
  591. typedef struct bfibchar {
  592. #if (SOZOBON  && __SOZOBONX__ < 0x223)
  593.     unsigned iconchar:8;
  594.     unsigned bgcolor:4;
  595.     unsigned iconcolor:4;
  596. #else
  597.     unsigned iconcolor:4;
  598.     unsigned bgcolor:4;
  599.     unsigned iconchar:8;
  600. #endif
  601. } bfIBCHAR;
  602.  
  603. typedef struct Xicon_block {
  604.     short        *ib_pmask;
  605.     short        *ib_pdata;
  606.     char        *ib_ptext;
  607.     bfIBCHAR     ib_char;
  608.     short        ib_xchar;
  609.     short        ib_ychar;
  610.     short        ib_xicon;
  611.     short        ib_yicon;
  612.     short        ib_wicon;
  613.     short        ib_hicon;
  614.     short        ib_xtext;
  615.     short        ib_ytext;
  616.     short        ib_wtext;
  617.     short        ib_htext;
  618. } XICONBLK;
  619.  
  620. typedef struct cicon_data {
  621.     short    num_planes;         /* number of planes in the following data */
  622.     short    *col_data;            /* pointer to color bitmap in standard form */
  623.     short    *col_mask;            /* pointer to single plane mask of col_data */
  624.     short    *sel_data;            /* pointer to color bitmap of selected icon */
  625.     short    *sel_mask;            /* pointer to single plane mask of selected icon */
  626.     struct    cicon_data *next_res;    /* pointer to next icon for a different resolution */
  627. } CICON;
  628.  
  629. typedef struct cicon_blk {
  630.     ICONBLK monoblk;    /* default monochrome icon */
  631.     CICON *mainlist;    /* list of color icons for different resolutions */
  632. } CICONBLK;
  633.  
  634.  
  635.  
  636. typedef struct bit_block {
  637.     short    *bi_pdata;                    /* ptr to bit forms data    */
  638.     short    bi_wb;                        /* width of form in bytes    */
  639.     short    bi_hl;                        /* height in lines            */
  640.     short    bi_x;                        /* source x in bit form        */
  641.     short    bi_y;                        /* source y in bit form        */
  642.     short    bi_color;                    /* fg color of blt            */
  643. } BITBLK;
  644.  
  645.  
  646. typedef struct user_blk {
  647.     short (*ub_code)(struct parm_blk *p_blk);
  648.     long ub_parm;
  649. } USERBLK;
  650.  
  651. #define appl_blk user_blk
  652. #define APPLBLK    USERBLK
  653.  
  654. typedef struct bfObspec {    /*  a bitfield for the ???BOX opsec    */
  655. #if (SOZOBON  && __SOZOBONX__ < 0x223)
  656. #pragma echo little endian bitfields
  657.     signed    framesize:8;
  658.     unsigned character:8;
  659.     unsigned innercol:4;
  660.     unsigned fillpat:3;
  661.     unsigned textmode:1;
  662.     unsigned textcol:4;
  663.     unsigned framecol:4;
  664. #else
  665. #pragma echo std bitfields
  666.     unsigned character:8;
  667.     signed     framesize:8;
  668.     unsigned framecol:4;
  669.     unsigned textcol:4;
  670.     unsigned textmode:1;
  671.     unsigned fillpattern:3;                    /* fillpat avant = erreur */
  672.     unsigned interiorcol:4;                        /* innercol avant = erreur */
  673. #endif
  674. } bfOBSPEC;
  675.  
  676. typedef union Obspec {
  677.     long    index;                        /*obspec avant = erreur */
  678.     bfOBSPEC obspec;
  679.     TEDINFO    *tedinfo;
  680.     ICONBLK    *iconblk;
  681.     CICONBLK *ciconblk;
  682.     BITBLK    *bitblk;
  683.     USERBLK    *userblk;
  684.     char    *free_string;
  685.     struct Swinfo *swinfo;        /* MagiC    */
  686.     struct Popinfo *popinfo;    /* MagiC    */
  687. } OBSPEC;
  688.  
  689. typedef struct object {
  690.     short            ob_next;        /* -> object's next sibling        */
  691.     short            ob_head;        /* -> head of object's children */
  692.     short            ob_tail;        /* -> tail of object's children */
  693.     unsigned short    ob_type;        /* type of object                */
  694.     unsigned short    ob_flags;        /* flags                        */
  695.     unsigned short    ob_state;        /* state                        */
  696. /*    long            ob_spec; */ /* replaced by following UNION -jerry-    */
  697.     OBSPEC            ob_spec;    /* whatever: ob_spec.obspec ...        */
  698.     short            ob_x;            /* upper left corner of object    */
  699.     short            ob_y;            /* upper left corner of object    */
  700.     short            ob_width;        /* width of obj                    */
  701.     short            ob_height;        /* height of obj                */
  702. } OBJECT;
  703.  
  704. typedef struct parm_blk {
  705.     OBJECT    *pb_tree;
  706.     short    pb_obj;
  707.     short    pb_prevstate;
  708.     short    pb_currstate;
  709.     short    pb_x, pb_y, pb_w, pb_h;
  710.     short    pb_xc, pb_yc, pb_wc, pb_hc;
  711.     long    pb_parm;
  712. } PARMBLK;
  713.  
  714.  
  715.  
  716.     /* MagiC objects:    */
  717. typedef struct Popinfo {
  718.     OBJECT    *tree;
  719.     short    obnum;
  720. } POPINFO;
  721.  
  722. typedef struct Swinfo {
  723.     char    *string;
  724.     short    num;
  725.     short    maxnum;
  726. } SWINFO;
  727.  
  728.  
  729.  
  730. /*-------------------------------------------------------------------------
  731.  * RSHDR structure...
  732.  *-----------------------------------------------------------------------*/
  733.  
  734. typedef struct rshdr {
  735.     short            rsh_vrsn;        /* Resource structure version # */
  736.     unsigned short    rsh_object;        /* Offset to first object        */
  737.     unsigned short    rsh_tedinfo;    /* Offset to first tedinfo        */
  738.     unsigned short    rsh_iconblk;    /* Offset to first iconblk        */
  739.     unsigned short    rsh_bitblk;        /* Offset to first bitblk        */
  740.     unsigned short    rsh_frstr;        /* Offset to free string index    */
  741.     unsigned short    rsh_string;        /* Offset to string data        */
  742.     unsigned short    rsh_imdata;        /* Offset to image data            */
  743.     unsigned short    rsh_frimg;        /* Offset to free image index    */
  744.     unsigned short    rsh_trindex;    /* Offset to tree index            */
  745.     unsigned short    rsh_nobs;        /* Number of objects            */
  746.     unsigned short    rsh_ntree;        /* Number object trees            */
  747.     unsigned short    rsh_nted;        /* Number of tedinfo structs    */
  748.     unsigned short    rsh_nib;        /* Number of iconblk structs    */
  749.     unsigned short    rsh_nbb;        /* Number of bitblk structs        */
  750.     unsigned short    rsh_nstring;    /* Number of free strings        */
  751.     unsigned short    rsh_nimages;    /* Number of free images        */
  752.     unsigned short    rsh_rssize;        /* total bytes in resource        */
  753. } RSHDR;
  754.  
  755. #define RSHDR_DEFINED 1 /* signal to other header files that RSHDR is done */
  756.  
  757.  
  758. typedef struct _menu
  759. {
  760.     OBJECT *mn_tree;        /*  - the object tree of the menu     */
  761.     short    mn_menu;         /* - the parent object of the menu items     */
  762.     short    mn_item;         /* - the starting menu item    */
  763.     short    mn_scroll;     /* - the scroll field status of the menu    */
  764.                     /* 0    - The menu will not scroll    */
  765.                     /* !0 - it will scroll if the number of menu
  766.                      *     items exceed the menu scroll height. The 
  767.                      * NOTE: If the scroll field status is !0, the menu
  768.                      *     items must consist entirely of G_STRINGS.
  769.                      */
  770.     short    mn_keystate;    /* - The CTRL, ALT, SHIFT Key state at the time the    */
  771. } MENU;
  772.  
  773. typedef struct _mn_set {
  774.     long    Display;     /* - the submenu display delay    */
  775.     long    Drag;         /* - the submenu drag delay    */
  776.     long    Delay;         /* - the single-click scroll delay    */
  777.     long    Speed;         /* - the continuous scroll delay    */
  778.     short    Height;     /* - the menu scroll height    */
  779. } MN_SET;
  780.  
  781.  
  782.     /* new shel_write calls (AES 4.00, MagiC)    */
  783.  
  784. /* MultiTOS (AES 4.00 and up) */
  785.  
  786. extern    short shel_write(short sh_wdoex, short sh_wisgr, short sh_wiscr,
  787.                     void *sh_wpcmd, char *sh_wptail);
  788.  
  789. /* sh_wdoex values:    */
  790. #define    SHW_LAUNCH    0x0000
  791. #define    SHW_RUNAPP    0x0001
  792. #define    SHW_RUNACC    0x0003
  793. #define    SHW_SHUTDN    0x0004
  794. #define    SHW_CHGRES    0x0005
  795. #define    SHW_BRCAST    0x0007
  796. #define    SHW_AESENV    0x0008
  797. #define    SHW_RECMSG    0x0009
  798. #define    SHW_SENDAES    0x000A
  799. /*
  800.  *  extended sh_wodex values, 'or' with one of the upper first 3 and
  801.  *  use a SH_WPCMD * for sh_wpcmd parameter
  802.  */
  803. #define    SHW_PSETL    0x0100
  804.     /* use psetlimit value from SH_WPCMD for the new process    */
  805. #define    SHW_PRENI    0x0200
  806.     /* use prenice value from SH_WPCMD for the new process    */
  807. #define    SHW_SCWD    0x0400    
  808.     /* chdir to cwd from SH_WPCMD for the new process    */
  809. #define    SHW_SENV    0x0800
  810.     /* use the environment strings from SH_WPCMD and not AES' ones    */
  811.  
  812. /* sh_wisgr    valid for (sh_wdoex & SHW_RUNAPP), i.e. 0x0001
  813.     0 : GEM application
  814.     1 : no GEM appication    */
  815.  
  816. typedef struct    Sh_wpcmd {
  817.     char    *cmd;            /* the command, needs no path or extension    */
  818.     long    psetlimit;
  819.     long    prenice;
  820.     char    *cwd;            /* the new process' cwd or NULL    */
  821.     char    *env;            /* the new process' environment or NULL    */
  822. } SH_WPCMD;
  823.  
  824.  
  825. /*     MagiC shel_write:
  826.     extern    short shel_write(short doex, short isgr, 
  827.                 short isover, char *pcmd, char *ptail);
  828.  
  829.     doex is always 1 ??
  830.     isgr is to set:
  831.         1 : for a GEM application
  832.         0 : for a no GEM appication
  833.  */
  834. /* important isover values */
  835. #define SHW_IMMED    0
  836. #define    SHW_CHAIN    1
  837. #define    SHW_PARALLEL    100
  838. #define    SHW_SINGLE        101
  839.  
  840.  
  841.  
  842.     /* special MagiC AES structures    */
  843.  
  844. typedef    struct Scanx {
  845.     char scancode;
  846.     char nclicks;
  847.     int  objnr;
  848. } SCANX;
  849.  
  850. typedef struct Xdo_inf {
  851.     SCANX *unsh;
  852.     SCANX *shift;
  853.     SCANX *ctrl;
  854.     SCANX *alt;
  855.     void  *resvd;
  856. } XDO_INF;
  857.  
  858.  
  859.     /* special xaesfast structures    */
  860.  
  861. typedef struct xmouse {
  862.     short retval;
  863.     short bclicks;
  864.     short mask;
  865.     short state;
  866.     short status;
  867.     short mousex;
  868.     short mousey;
  869.     short mouseb;
  870.     short keystate;
  871. } XMOUSE;
  872.  
  873. typedef struct xmulti {
  874.     short    msgbuf[8];    /* msg buffer    */
  875.     short    mflags,            /* click events    */
  876.                 mbclicks,
  877.                 mbmask,
  878.                 mbstate,
  879.                 mm1flags;        /* mouse rect events    */
  880.     GRECT    mm1rect;
  881.     short    mm2flags;
  882.     GRECT    mm2rect;
  883.     short    mtlocount,    /* timer events    */
  884.                 mthicount;
  885.     short    mwhich,            /* the return value, again    */
  886.                 mmox,                /* the mouse state    */
  887.                 mmoy,
  888.                 mmobutton,
  889.                 mmokstate,    /* the key state    */
  890.                 mkreturn,        /* the key    */
  891.                 mbreturn;        /* the mouse button    */
  892. } XMULTI;
  893.  
  894.  
  895.     /* now the AES variables    */
  896. extern    void *aespb[6];                /* The AES parameter Block    */
  897. extern    short aescontrol[5];        /* AES contrl[] array    */
  898. extern short global[15];            /* AES global[] array    */
  899.     /* in there is    */
  900. extern    short    gl_apversion;    /* the AES version number    */
  901. extern    short    gl_apcount;        /* max # of concurrent AES applications    */
  902. extern    short    gl_apid;        /* id of the current application    */
  903. extern    long    gl_apprivate;    /* anything application wants to store     */
  904. extern    OBJECT    **gl_apptree;    /* pointer to array of object tree ptrs    */
  905. extern    short    gl_ap1resv[];    /* global[7,8] pointer to head of rsc data    */
  906. extern    RSHDR    *gl_apprshdr;    /* pointer to head of rsc data    */
  907. extern    short    gl_ap2resv[6];    /* the rest of global array global[9-14]    */
  908. /* global[13, 14] not all AES versions:    */
  909. extern    short    _gl_chheight;    /* character heigth of AES font    */
  910. extern    short    _gl_smchheight;    /* character heigth of small AES font    */
  911.  
  912. /* some function prototypes    */
  913.  
  914. extern    short vq_gdos();
  915. extern    unsigned long vq_vgdos();
  916. extern    void c_vdi(short *pb[5]);
  917.  
  918. extern short vqt_name(short handle, short index, char *name);
  919.             /* char name[33], name[32] is only set with NVDI     */
  920. extern short vqt_nvdi_name(short handle, short index, char *name, 
  921.         char *face, unsigned short *vecflag, unsigned short *font_format,
  922.         unsigned short *flags);
  923.             /* char name[17], char face[17] both [16] set to '\0'    */
  924. extern short vqt_x_name(short handle, short index, char *name,
  925.         unsigned short *vecflag, unsigned short *font_format, 
  926.         unsigned short *flags);
  927.             /* char name[33], name[32] is set to '\0'    */
  928.  
  929.  
  930. extern    void c_aes(unsigned long control, short *int_in, short *int_out,
  931.                         void *addr_in, void *addr_out);
  932. extern    void call_aes(unsigned long control);
  933. extern    void callaes(void);
  934.  
  935. /* special MagiC (including some GEM 2.x/3.x) AES functions    */
  936.  
  937. extern    short    form_xdial(short flag,
  938.             short littlx, short littly, short littlw, short littlh,
  939.             short bigx, short bigy, short bigw, short bigh,
  940.             void **flydial, void *dummy); /* dummy maybe a 'NULL' */
  941. extern    short    form_xdo( OBJECT *form, short start, short *lastcrsr,
  942.                         XDO_INF *tabs, void *flydial);
  943. extern    short    form_xerr(long errcode, char *errfile);
  944. extern    short    form_popup(OBJECT *tree, short x, short y);
  945. extern    short    scrp_clear();
  946. extern    void    shel_rdef(char *lpcmd, char *lpdir);
  947. extern    void    shel_xrdef(char *lpcmd, char *lpdir, char **buffer);
  948. extern    void    shel_wdef(char *lpcmd, char *lpdir);
  949. extern    short    menu_click(short val, short setit);
  950. extern    short    menu_unregister(short mid);
  951.  
  952. #if 0
  953. /* not in current version    */
  954. extern    short    appl_yield();
  955. #endif
  956.  
  957.  
  958.  
  959.  
  960. /**************************************************************************
  961.  *
  962.  * Name compatibility stuff.
  963.  *
  964.  *    05/26/90 - v1.4
  965.  *                Added mapping of find_exttype to obj_xtfind.
  966.  *    08/28/89 - v1.3
  967.  *                In v1.3, a big push has been made to make a consistant
  968.  *                naming standard for the AES utilities.    To avoid breaking
  969.  *                a lot of existing code, the following block will direct
  970.  *                the old names to the new routines.
  971.  *
  972.  *************************************************************************/
  973.  
  974. #define objclg_adjust            rc_gadjust
  975. #define objclv_adjust            rc_vadjust
  976.  
  977. #define objrb_which(a,b)        obj_rbfind((a),(b),SELECTED)
  978. #define obj_rbwhich(a,b)        obj_rbfind((a),(b),SELECTED)
  979. #define objxrb_which            obj_rbfind
  980.  
  981. #define objc_xywh                obj_xywh
  982.  
  983. #define find_exttype            obj_xtfind
  984.  
  985. #define objst_change            obj_stchange
  986. #define objfl_change            obj_flchange
  987.  
  988. #define    gl_aprshdr                gl_apprshdr
  989.  
  990.     /* AES related Functions  extensions to the standard GEM Lib    */
  991.  
  992. extern    void do_bell(short res, void* res2);    
  993.         /* beep without any console access!!    */
  994.  
  995. extern short evnx_multi(XMULTI *xm);
  996. extern void rsc_treefix(OBJECT *ptree);
  997. extern void rsc_gstrings(OBJECT *ptree, short object, char **ppstr, ...);
  998. extern void rsc_sstrings(OBJECT *ptree, short object, char *pstr, ...);
  999. extern long rsc_gspec(OBJECT *tree, short object);
  1000. extern char *rsc_gpointer (OBJECT *tree, short object);
  1001. extern void rsc_sspec(OBJECT *tree, short object, long obspec_value);
  1002. extern void rsc_spointer(OBJECT *tree, short object, char *pointer);
  1003. extern GRECT *rc_gadjust(GRECT *prect, short hadjust, short vadjust);
  1004. extern VRECT *rc_vadjust(VRECT *prect, short hadjust, short vadjust);
  1005. extern GRECT *rc_vtog(VRECT *pvrect, GRECT *pgrect);
  1006. extern VRECT *rc_gtov(GRECT *pgrect, VRECT *pvrect);
  1007. extern void rc_union(GRECT *sourcerect, GRECT *destrect);
  1008. extern short rc_intersect(GRECT *sourcerect, GRECT *destrect);
  1009. extern void rc_copy(void *sourcerect, void *destrect);
  1010. extern short rc_equal(void *rect1, void *rect2);
  1011. extern void objcl_calc (OBJECT *tree, short object, GRECT *grect, VRECT *vrect);
  1012. extern void obj_flchange(OBJECT *ptree, short object, short newflags, short drawflag, ...);
  1013. extern void obj_stchange(OBJECT *ptree, short object, short newstate, short drawflag, ...);
  1014. extern void obj_offxywh(OBJECT *ptree, short object, GRECT *prect);
  1015. extern void obj_xywh(OBJECT *ptree, short object, GRECT *prect);
  1016. extern short obj_xtfind(OBJECT *ptree, short parent, short xtype);
  1017. extern short obj_rbfind(OBJECT *ptree, short parent, short rbstate);
  1018. extern short obj_rbselect(OBJECT *ptree, short selobj, short selstate);
  1019. extern short obj_parent(OBJECT *ptree, short object);
  1020. extern short frmx_center(OBJECT *ptree, GRECT *prect);
  1021. extern short winx_calc(short type, short kind, GRECT inrect, GRECT *outrect);
  1022. extern short winx_get(short whandle, short field, GRECT *outrect);
  1023.  
  1024. #include <aes.h>
  1025. #include <vdi.h>
  1026.  
  1027. #endif
  1028.  
  1029. /*    end of xgemfast.h */
  1030.